package com.bw1806.utils;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * @描述
 * @创建人 wangyue
 * @创建时间2020/11/2011:25
 */

public class SecutityUtils {


    public static String getLoginUser(){
        return SecurityContextHolder.getContext().getAuthentication().getName();
    }

    public static void main(String[] args) {
        BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
        String password = passwordEncoder.encode("123456");
        System.out.println(password);
    }
}
